from ccfs.fscplex import fscplex

f = open("../output/bench_singlebigm.txt", 'w')
header =  "%4s %4s" % ('NI', 'NS')
header += "%10s %10s %10s" % ("BigM", "Obj", "Nodes")
#header += "%10s %10s" % ('t_stre', 't_bigm')
header += "\n"
f.write(header)

NI = 20
NS = 20

fc = fscplex()
fc.generate_instance(NI, NS, eps=0.2)
fc.parameters.read_file("../../param/stofac.prm")
fc.write("fc.lp")

for i in range(50):
    bigm_val = 0.1 * i
    fc.set_bigm_one([bigm_val])
    fc.solve()
    bigm_obj_val=fc.solution.get_objective_value()
    bigm_num_nodes = fc.solution.progress.get_num_nodes_processed()
    line = "%4d %4d  " % (i, i)
    line += "%10f %10f %10d" % (bigm_val, bigm_obj_val, bigm_num_nodes)
    #line += "%10f %10f"% (time_stre, time_bigm)
    line += "\n"
    f.write(line)

f.close()
    
